package PontoEletronico;

import java.awt.*;    
import java.net.URL;

import javax.swing.*;  
 
@SuppressWarnings("serial")
public class Background extends JDesktopPane {  
  
    private Image image;  
    
    public Background() {
    	this.setBounds(0, 0, 800, 600);
    	this.setLayout(null);
        final URL url = getClass().getResource("img/Ponto_Eletronico.png");
        this.image = new ImageIcon(url).getImage().getScaledInstance(760, 560, 100);        
    }  
  
    public void paintComponent(Graphics g) {    
    	Dimension dDesktop = this.getSize();  
        int width = (int) (dDesktop.getWidth()-image.getWidth(getRootPane()));  
        int height = (int) (dDesktop.getHeight()-image.getHeight(getRootPane()));
        g.drawImage(image, width/2, height/2, this); 
       
    }
}  
		
		
		